package beans;

import javax.persistence.*;

@Entity
public class Tarjeta extends MedioPago
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1087487805807271411L;

	@Id
	private int nroTarjeta;
	
	@Column
    private String banco;

	public Tarjeta() {}

	public int getNroTarjeta() {
		return nroTarjeta;
	}

	public void setNroTarjeta(int nroTarjeta) {
		this.nroTarjeta = nroTarjeta;
	}

	public String getBanco() {
		return banco;
	}

	public void setBanco(String banco) {
		this.banco = banco;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((banco == null) ? 0 : banco.hashCode());
		result = prime * result + nroTarjeta;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Tarjeta other = (Tarjeta) obj;
		if (banco == null) {
			if (other.banco != null)
				return false;
		} else if (!banco.equals(other.banco))
			return false;
		if (nroTarjeta != other.nroTarjeta)
			return false;
		return true;
	}
	
}
